import openpyxl
"""
a1      b1      c1          d1        e1    f1         g1     h1
姓名	Java成绩	python成绩	mysql成绩	js成绩   总分	平均分	排名

"""
wb = openpyxl.load_workbook("7106.xlsx")
ws = wb.active
rngs = ws['a2:e5']
name = ''
jv =0
py =0
ms =0
js =0

"""
v1.1
https://gitee.com/huilei567/py.git
try:
    for i in rngs:
        t =0
        print(f"{name}的Java成绩{ja}	python成绩{py}	mysql成绩{ms}	js成绩{js}")
        for j in i:
            t+=1
            if t==1:
                name =j.value
            elif t==2:
                jv=j.value
            elif t == 3:
                py = j.value
            elif t == 4:
                ms = j.value
            elif t == 5:
                js = j.value
        # print(f"{name}的Java成绩{ja}	python成绩{py}	mysql成绩{ms}	js成绩{js}")
except:
    print("程序有误！！！")
"""
try:
    for i in rngs:
        t = 0

        for j in i:
            t += 1
            if t == 1:
                name = j.value
            elif t == 2:
                jv = j.value
            elif t == 3:
                py = j.value
            elif t == 4:
                ms = j.value
            elif t == 5:
                js = j.value
        print(f"{name}的Java成绩:{jv}\tpython成绩:{py}\tmysql成绩:{ms}\tjs成绩:{js}")
except:
    print("程序有误！！！")









